//
//  LJMainTableView.m
//  OpenPractice
//
//  Created by  lijinghua on 16/2/29.
//  Copyright © 2016年  lijinghua. All rights reserved.
//

#import "LJMainTableView.h"

@interface LJMainTableView ()<UITableViewDataSource,UITableViewDelegate>

@end
@implementation LJMainTableView

-(instancetype)initWithFrame:(CGRect)frame{
    self =[super initWithFrame:frame];
    //    设置代理和数据源
    self.delegate=self;
    self.dataSource=self;
    
    self.rowHeight=50;
    
    self.separatorStyle=NO;
    return  self;
}



//实现数据源方法
-(NSInteger)numberOfRowsInSection:(NSInteger)section{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    if (indexPath.row==0) {
        cell.imageView.image=[UIImage imageNamed:@"sidebar_business"];
        cell.textLabel.text=@"学习笔记";
    }else if (indexPath.row==1){
        cell.imageView.image=[UIImage imageNamed:@"sidebar_purse"];
        cell.textLabel.text=@"知识海洋";
    }else if (indexPath.row==2){
        cell.imageView.image=[UIImage imageNamed:@"sidebar_decoration"];
        cell.textLabel.text=@"师门好友";
    }else if (indexPath.row==3){
        cell.imageView.image=[UIImage imageNamed:@"sidebar_favorit"];
        cell.textLabel.text=@"赏金榜";
    }else if (indexPath.row==4){
        cell.imageView.image=[UIImage imageNamed:@"sidebar_album"];
        cell.textLabel.text=@"吐槽";
    }else{
        cell.imageView.image=[UIImage imageNamed:@"sidebar_file"];
        cell.textLabel.text=@"我的任务";
    }
    
    cell.backgroundColor=[UIColor clearColor];
    cell.textLabel.textColor=[UIColor whiteColor];
    //    点击cell时没有点击效果
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    
    return cell;
    
    
}

@end
